About the Demo

This demo shows how to interact with the design time representation of your model. The design time model ("ModelLayer") is actually a full blown ECO application. That means we can easily access it using OCL.

Setup Information

  1. Compile EcoSpaceDesignerPlugins.bdsproj to get EcoSpaceDesignerPlugins.dll
  2. Make the DLL known to the IDE by adding the following information into the registry:
    [HKEY_CURRENT_USER\Software\Borland\BDS\<<version>>\Known IDE Assemblies]
    "<<full path to directory containing the dll>>\\ModelAudit.dll"="Eco ModelAudit example"
    
    A few things worth noting:

    <<version>> - should be replaced with the version of your IDE.

    <<full path to directory containing the dll>> - should be replaced with the absolute path to the DLL. 

  3. Restart the IDE.
  4. Create a new ECO Application. You should have new buttons on the lower toolbar in the EcoSpaceDesigner.
Note:If you have installed the DLL as described above, you need to close the IDE, uninstall the DLL and restart the IDE in order to recompile the DLL.

Running the Demo

Assuming you have installed the demo as outlined above, you will get a new button in the EcoSpace designer. That button brings up a simple form where you can specify your validation rules. Rules are made up of
  1. Name - Name of the rule
  2. Description - Description of the rule
  3. Enabled - Indication if the rule is enabled or not
  4. ContextExpression - An OCL expression yielding a set of meta elements to which the rule applies.
  5. RuleExpression - An OCL expression evaluated against each element returned by ContextExpression.

When running the audit, each enabled rule will first get the ContextExpression evaluated, then for each element in the set RuleExpression will be evaluated. If no RuleExpression evaluation returns false, the message

[Name] Evaluated ok
will be emitted. Each time a RuleExpression evaluates to false, the name of the object breaking the rule and the rule's name will be printed.